#ifndef TOOLMODES_H
#define TOOLMODES_H
#include "StomperLib/Objects/EditorObjectList.h"
#include <Gwen/Controls/Base.h>

static const int SelectMode = 0x2;
static const int DeleteMode = 0x4;
static const int TranslateMode = 0x22;
static const int RotateMode = 0x42;
static const int ResizeMode = 0x62;

static const std::string WinSeparator = "\\";
static const std::string DefaultSeparator = "/";

namespace StomperLib
{
class ToolModel : public Gwen::Controls::Base
{
 public:

  ToolModel( Gwen::Controls::Base* base ) : Gwen::Controls::Base ( base ) {
    Mode = SelectMode;
    ObjectList = new StomperLib::EditorObjectList( this );
    Modified = false;
  }

  virtual ~ToolModel( ) {
  }

 public:

  void OnOpenProject( )
  {
    Modified = false;
  }

  void NotifyModification( std::string fileName )
  {
    this->Modified = true;
    Gwen::Event::Information info;
    info.String = fileName;
    onModified.Call( this, info );
  }

  void NotifySaved( std::string fileName )
  {
    this->Modified = false;
    Gwen::Event::Information info;
    info.String = fileName;
    onSaved.Call( this, info );
  }

  std::string GetBaseFileName( std::string fileName )
  {
    return fileName.substr( 0, fileName.find_last_of( "." ));
  }

  Gwen::Event::Caller onModified;
  Gwen::Event::Caller onSaved;

 public:

  int Mode;
  StomperLib::EditorObjectList* ObjectList;
  bool Modified;
  std::string CurrentWorkingFile;
  std::string ProjectFile;

 private:

};

}

#endif // ifndef TOOLMODES_H